package com.wes.dsptest.audioalarm;

import android.content.Context;
import android.media.MediaPlayer;
import android.os.Build;

import androidx.annotation.RequiresApi;

import java.io.File;
import java.io.IOException;

public class AudioFunction {
    private String musicName = "null";
    private AudioAlarm audioAlarm;
    private AudioPlayerUtil audioPlayerUtil;

    public AudioFunction(Context context, IAudioControl control) {
        audioAlarm = new AudioAlarm(context);
        audioPlayerUtil = new AudioPlayerUtil(control);
    }

    public AudioAlarm getAudioAlarm(){
        return audioAlarm;
    }

    public AudioPlayerUtil getAudioPlayerUtil(){
        return audioPlayerUtil;
    }

    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    public void openAudioAlarm(boolean set) {
        audioAlarm.openAlarm(set);
    }

    public void setAlarmTime(int hour, int min) {
        audioAlarm.setAlarmTime(hour, min);
    }

    public int[] getAlarmTime() {
        return audioAlarm.getAlarmTime();
    }

    public String getStringAlarmTime() {
        return audioAlarm.getStringAlarmTime();
    }

    public void setMusicName(String pathString) {
        this.musicName = pathString;
        audioAlarm.setAlarmMusicName(pathString);
    }

    public String getMusicName() {
        return musicName;
    }




}
